import java.util.*;

/**
 * @author LKQ
 * @date 2022/4/19 20:33
 * @description 反序中序遍历
 */
public class Solution {
    public static void main(String[] args) {

    }
    int sum = 0;
    public TreeNode convertBST(TreeNode root) {
        if (root != null) {
            convertBST(root.right);
            sum += root.val;
            root.val = sum;
            convertBST(root.left);
        }
        return root;
    }
}
